<HTML><HEAD><TITLE>store_erase(+StoreHandle)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Non-logical Variables, Arrays, Bags, Shelves and Stores</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>store_erase(+StoreHandle)</H1>
Erase the contents of the specified store object
<DL>
<DT><EM>StoreHandle</EM></DT>
<DD>A store handle or store name
</DD>
</DL>
<H2>Description</H2>
    	This erases the contents of the store object and frees the associated
	memory. The store object itself remains valid and is equivalent to a
	newly created store.
<P>
	Note that anonymous stores (which are referred to by handle rather
	than name) are automatically erased and destroyed when their handle
	gets garbage collected, or when failing across their creation point.
<P>
	On the other hand, named stores should be explicitly erased,
	otherwise their contents will continue to occupy memory.
<P>
	Calling store_erase/1 is equivalent to deleting every entry in
	the store via store_delete/2.
<P>
	Note: If StoreHandle is not a handle, then it must be an atom or a
	compound term, and the store is identified by this term's toplevel
	functor together with the context module.
	.
    
<H3>Modes and Determinism</H3><UL>
<LI>store_erase(+) is det
</UL>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>StoreHandle is uninstantiated
<DT><EM>(5) type error </EM>
<DD>StoreHandle is neither atom nor compound term nor store handle
<DT><EM>(45) record does not exist </EM>
<DD>StoreHandle is not the name of a store
</DL>
<H2>Examples</H2>
<PRE>

    ?- store_create(Handle),
       store_set(Handle, key, value),
       stored_keys_and_values(Handle, Data1),
       store_count(Handle, N1),
       store_erase(Handle),
       stored_keys_and_values(Handle, Data2),
       store_count(Handle, N2).

    Handle = 'STORE'(16'002f4da0)
    Data1 = [key - value]
    N1 = 1
    Data2 = []
    N2 = 0
    Yes (0.00s cpu)
    </PRE>
<H2>See Also</H2>
<A HREF="../../kernel/storage/store-1.html">store / 1</A>, <A HREF="../../kernel/modules/local-1.html">local / 1</A>, <A HREF="../../kernel/storage/store_set-3.html">store_set / 3</A>, <A HREF="../../kernel/storage/store_get-3.html">store_get / 3</A>, <A HREF="../../kernel/storage/store_delete-2.html">store_delete / 2</A>, <A HREF="../../kernel/storage/store_contains-2.html">store_contains / 2</A>, <A HREF="../../kernel/storage/stored_keys-2.html">stored_keys / 2</A>, <A HREF="../../kernel/storage/stored_keys_and_values-2.html">stored_keys_and_values / 2</A>, <A HREF="../../kernel/storage/store_create-1.html">store_create / 1</A>, <A HREF="../../kernel/storage/store_count-2.html">store_count / 2</A>
</BODY></HTML>
